1. Field of the Invention
The present invention relates generally to analyzing digital images, and more particularly, to methods and systems for determining the various colors included in a digital image.
2. Description of the Related Art
Digital images are used extensively for many purposes. Digital images offer many advantages over photographic images because digital images can easily be electronically indexed, archived, retrieved and distributed, among many other uses. As a result of the many uses, digital images are often transferred across all types of communication networks.
Digital images are typically relatively large-sized data files. Due to the frequent distribution of digital images, many different approaches have been used to increase the efficiency with which the relatively large file sizes can be distributed. Some of the approaches have focused on compressing the digital image using various compression schemes.
The process of compressing a digital image requires the digital image to be analyzed to determine the type of digital image. For example, digital images can be classified according to the number of colors included in the digital image. A digital image with fewer colors can be more easily compressed than can an image having a greater number of colors. Therefore, a first compression scheme may be optimized for compressing a digital image with a relatively few colors (e.g., less than about 16 colors) whereas a second compression scheme may be optimized for digital images having many colors (e.g., more than about 16 colors or 256 or more colors). The first compression scheme would generally operate faster than the second compression scheme and therefore would be more efficient to use if the digital image has few colors.
However, each individual pixel of the digital image must be analyzed to determine the respective color of each of the pixels. The color of each of the pixels must be determined to determine the actual number of colors included in the digital image. Once the entire digital image has been analyzed, then the most efficient compression scheme can be selected.
As a result, the typical digital image compression process requires each and every one of the pixels in the digital image to be processed twice. First, each and every one of the pixels must be analyzed to determine the appropriate compression scheme. Then, each and every one of the pixels must again be processed by the selected compression scheme. As a result, the process of selecting the compression scheme and compressing the digital image can require a relatively extended processing time. This extended processing time can therefore delay the use (e.g., distribution, retrieval, storing, etc.) of the digital image.
Another approach is to process the digital image through each one of multiple compression schemes and then select the compression scheme that yielded the most efficient results. However, this approach can easily consume even more time and processing resources than analyzing each pixel of the digital image.
Still another approach is to select a compression scheme that is ideal for a worst-case scenario (i.e., where the maximum number of colors are present in the digital image). However, under this approach, the single selected compression scheme is not the most efficient because many of the digital images will have fewer than the maximum number of colors. In view of the foregoing, there is a need for a more efficient system and method for selecting and applying an appropriate compression scheme to a digital image.